home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / octa209s.zip / octave-2.09 / liboctave / mach-info.h < prev    next >
C/C++ Source or Header  |  1996-07-14  |  2KB  |  84 lines

  1. /*
  2.  
  3. Copyright (C) 1996 John W. Eaton
  4.  
  5. This file is part of Octave.
  6.  
  7. Octave is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2, or (at your option) any
  10. later version.
  11.  
  12. Octave is distributed in the hope that it will be useful, but WITHOUT
  13. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15. for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with Octave; see the file COPYING.  If not, write to the Free
  19. Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  20.  
  21. */
  22.  
  23. #if !defined (octave_mach_info_h)
  24. #define octave_mach_info_h 1
  25.  
  26. #include <string>
  27.  
  28. class
  29. oct_mach_info
  30. {
  31. public:
  32.  
  33.   enum float_format
  34.     {
  35.       native,
  36.       unknown,
  37.       ieee_little_endian,
  38.       ieee_big_endian,
  39.       vax_d,
  40.       vax_g,
  41.       cray
  42.     };
  43.  
  44.   oct_mach_info (void);
  45.  
  46.   static float_format native_float_format (void);
  47.  
  48.   static bool words_big_endian (void);
  49.  
  50.   static bool words_little_endian (void);
  51.  
  52.   static float_format string_to_float_format (const string&);
  53.  
  54.   static string float_format_as_string (float_format);
  55.  
  56. private:
  57.  
  58.   static oct_mach_info *instance;
  59.  
  60.   void init_float_format (void);
  61.  
  62.   void ten_little_endians (void);
  63.  
  64.   // The floating point format for the current machine.
  65.   float_format native_float_fmt;
  66.  
  67.   // TRUE if the byte order on this system is big endian.
  68.   bool big_chief;
  69.  
  70.   // No copying!
  71.  
  72.   oct_mach_info (const oct_mach_info&);
  73.  
  74.   oct_mach_info& operator = (const oct_mach_info&);
  75. };
  76.  
  77. #endif
  78.  
  79. /*
  80. ;;; Local Variables: ***
  81. ;;; mode: C++ ***
  82. ;;; End: ***
  83. */
  84.